<?php
namespace Home\Controller;
use Think\Controller;
/**
* ==============================================
*  http://www.liuhuanhui.cn
* ==============================================
* @date: 2014-10-10
* @author:liuhuanhui
* @encoding: UTF-8
*/
class ArticleController extends  Controller
{
	/**
	 *根据id显示文章
	 */
	function index()
	{
		$B=D('BlogsView');
		$this->blog=$B->find(I('bid'));
		if ($this->blog==null){
			$this->error("没有该信息，错误404！");
		}
		$B->where(array(id=>I('bid')))->setInc('readcount');
		$this->Next=$B->field('id,title')->where(array(id=>array('GT',I('bid'))))->find();
	
		$this->Prev=$B->field('id,title')->where(array(id=>array('LT',I('bid'))))->order('id desc')->find();
		
		$this->controls=D('PageControl')->where('page="View" and pid=0 and visible<>"n"')->order('number')->select();
		
		$this->display();
	}
	

}